<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
$(function(){
	$('#inputForm input').tooltip();
	$('#inputForm').checkForm();
    $('#inputForm').ajaxForm({ 
        type: "post",
        dataType:"json",
        beforeSubmit: function(){
	       $("#sbmBtn").attr("disabled","disabled");
        },
        clearForm: false,
        resetForm: false,
        success: function(resp){
        	if(resp.status == '1' ){
        		ui.msg(resp.msg, 1);
        		ui.go(_ctx + '/pet/dog_list.do');
        	}else{
        		ui.msg(resp.msg, 0);
        		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
        	}
        },
        error:function(resp){
        	ui.msg('请求发送失败', 0);
    		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
        }
    }); 
});
</script>
</head>
<body>
<%-- <%@ include file="/WEB-INF/view/common/topbar.jsp"%> --%>
<div class="main-container" id="main-container">
	<div class="main-container-inner">
		<%-- <%@ include file="/WEB-INF/view/common/sidebar.jsp"%> --%>
		<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<ul class="breadcrumb">
					<li>
						<i class="icon-home home-icon"></i>
						<a href="javascript:void(0);">首页</a>
					</li>
					<li>
						<a href="javascript:void(0);">狗狗</a>
					</li>
					<li class="active">新增</li>
				</ul>
			</div>

			<div class="page-content">
				<div class="row">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-header widget-header-flat">
								<!-- <h5 class="smaller lighter">
									<i class="icon-edit"></i> &nbsp;
								</h5> -->
								<div class="widget-toolbar no-border">
									<a class="btn btn-primary btn-xs" href="${ctx}/pet/dog_list.do"><i class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
								</div>
							</div>
							<div class="widget-body">
								<div class="widget-main">
									<form class="form-horizontal" role="form" id="inputForm" action="${ctx}/pet/update_dog.do" method="post">
										<input type="hidden" name="id" value="${vo.id}"/>	
										
										<div class="form-group">
											<label class="col-sm-3 control-label no-padding-right">昵称 *</label>
											<div class="col-sm-9">
												 <input type="text" class="col-xs-10 col-sm-5" 
													name="name" id="name" 
													value="${vo.name}"  oldValue="${vo.name}"  
													<%-- require="true" datatype="require|ajax" msg="请输入昵称|已经被占用" title="必填项"
													url="${ctx}/pet/dog_check_name.do" --%>/>
											</div>
										</div>
										
										<div class="space-4"></div>
										
										<div class="form-group">
											<label class="col-sm-3 control-label no-padding-right">性别 *</label>
											<div class="col-sm-9">
												<select name="sex" id="sex"  datatype="require" msg="必选项"  class="col-xs-10 col-sm-5" >
													<option value="" >--请选择--</option>
													<option value="1" <c:if test="${'1' == vo.sex }">selected</c:if>>男</option>
													<option value="2" <c:if test="${'2' == vo.sex }">selected</c:if>>女</option>
												</select>
											</div>
										</div>
										
										<div class="space-4"></div>
										
										<div class="form-group">
											<label class="col-sm-3 control-label no-padding-right">年龄</label>
											<div class="col-sm-9">
												<input type="text" class="col-xs-10 col-sm-5" 
													name="age" id="age" 
													value="${vo.age}" datatype="integer|range" min="1" max="100" msg="只能输入数字|年龄值范围1-100" title="必填项"/>
											</div>
										</div>
										<div class="space-4"></div>
										
										<div class="form-group">
											<label class="col-sm-3 control-label no-padding-right">生日</label>
											<div class="col-sm-9">
											   
												 <input type="text" class=" col-xs-10 col-sm-5" name="birthday" id="birthday" 
												 
										
												 onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true})" value="${vo.birthday}"/>
												<%--  <input type="text" class=" col-xs-10 col-sm-5" name="birthday" id="birthday" 
												     value="${vo.birthday}"onFocus="WdatePicker({ isShowClear:false,readOnly:true ,
												    	 onpicked:function(){this.blur()})" datatype="date"/> --%>
											</div>
										</div>
										<div class="space-4"></div>
										
										<div class="form-group">
											<label class="col-sm-3 control-label no-padding-right">毛色</label>
											<div class="col-sm-9">
												 <input type="text" class="col-xs-10 col-sm-5" name="color" id="color" value="${vo.color}"/>
											</div>
										</div>
										<div class="space-4"></div>
										
										<div class="clearfix form-group">
											<div class="col-md-offset-3 col-md-9">
											<button type="submit" class="btn btn-sm btn-info" id="sbmBtn"><i class="icon-ok bigger-110"></i>提交</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>
